Skip to content

Conversation

@Griboedoff
Copy link
Owner

No description provided.

Griboedoff and others added 4 commits November 5, 2016 19:38
? $"<{tag.Html}>{dataToInsert}</{tag.Html}>"
: dataToInsert;

public override string ToString()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

гитхаб до сих пор не научился в интерполяцию строк :(

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(

Markdown/Md.cs Outdated

if (Equals(tag, Tag.Em))
{
parsedTokens.Add(new HtmlToken(Tag.Empty, tokenData.ToString(), alreadyEscaped));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а вот весь этот блок в ифе никак нельзя как-нибудь вынести, а то уж слишкоом много действий в одном месте и это правда достаточно сложно прочитать

Markdown/Md.cs Outdated
return false;
try
{
return !(tagIndex == plainMd.Length - 1 && isOpenTag)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А можешь конъюнкты вынести в переменные? Скорее всего тут можно сделать так, чтобы это огромное условие читалось почти как предложение на английском языке

Markdown/Md.cs Outdated

public string Render()
{
TryParseToHtml();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void-методы не очень хороший паттерн. От этого метода можно ожидать что он вернёт html

Markdown/Md.cs Outdated
{
if (plainMd[tagIndex] != '_')
return false;
try
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

чёт лучше try-catch наверное не использовать, а проверить tagIndex. try-catch очень сильно замедляет выполнение

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants